<template>
	<view class="p20r f24r">
		<view class="backColWhite borRad10r overHid mb40r " v-for="(item, index) in detailedList"
		>
			<view class="lh100r pl20r pr20r backImgLiGrTR2c6739a99c043 colFff disFlex">
				<view class="flex1 foWeiBold f30r">
					领取会员卡
				</view>
				<view class="">
					加时长：{{
						item.type == 1 ? item.month + '个月' :
						item.type == 2 ? item.day + '天' : item.type
					}}
				</view>
			</view>
			<view class="pt20r pl20r pr20r">
				<view class="col999 disFlex mb20r">
					<view class="w120r">
						活动时间：
					</view>
					<view class="flex1">
						<view>
							开始：{{item.start_date}}
						</view>
						<view class="mt10r">
							结束：{{item.end_date}}
						</view>
					</view>
				</view>
				<view class="mb20r col999 disFlex">
					<view class="flex1">
						可领取次数：{{item.count}}
					</view>
					<view class="flex1">
						已领取次数：{{item.my_count}}
					</view>
					<view class="flex1">
						领取状态：
						<text :class="[item.is_draw == 2 ? 'col00c260' : 'colC72d21']">
							{{
								item.is_draw == 1 ? '未全领取' :
								item.is_draw == 2 ? '已全领取' : item.is_draw
							}}
						</text>
					</view>
				</view>
				<view class="teAliRight mb20r">
					<text class="w140r lh50r disInBlo teAliCenter boSiBorBox bor1S99c043 col99c043 borRad10r"
						v-if="item.status == 1 && item.is_draw == 1 && item.isCan == true"
						@click.stop="cliReceiveBtn(item.id)"
					>
						立即领取
					</text>
					<!-- <text class="w140r lh50r disInBlo teAliCenter colC72d21"
						v-if="item.status == 2 && item.is_draw == 1"
					>
						未全领取
					</text>
					<text class="w140r lh50r disInBlo teAliCenter col00c260"
						v-if="item.is_draw == 2"
					>
						已全领取
					</text> -->
				</view>
			</view>
		</view>
		<view class="pt10r pb30r teAliCenter col999 f26r" v-if="noMore == true && detailedList.length">
			已加载全部
		</view>
		<view class="col999 poAbs top50P left50P trTrn50Pn50P f26r" v-if="detailedList.length == 0">
			暂无活动
		</view>
	</view>
</template>
<script>
import { memberDrawCardTasks } from '@/utils/api.js'
export default {
	props: {
		detailedList: { type: Array, default: [] },
		noMore: { type: Boolean, default: false }
	},
	data() {
		return {
			
		}
	},
	methods: {
		cliReceiveBtn(id) {
			uni.showModal({
				title: '提示', content: '确定立即领取？', confirmColor: '#99c043',
				success:res1 => {
					if (res1.confirm) {
						memberDrawCardTasks({
							token: uni.getStorageSync('token'), id
						}).then(res2 => {
							this.$emit('refreshList');
							uni.showToast({
								title: '领取成功', duration: 3000
							})
						})
					}
				}
			})
		}
	}
}
</script>
<style>
</style>